<%-- 
    eCOM - Adopte un Presta - Mars-Avril 2013
    Document   : portfolio_architect
    Created on : Mar 26, 2013, 11:53:28 AM
    Author     : KJWT
--%>



<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%@page import="java.util.*"%>
<%@page import="entities.Product"%>
<%@page import="entities.Account"%>
<%@page import="entities.Photo"%>
<%@page import="dao.Idao"%>
<%@page import="dao.DaoJpa"%>
<%@page import="javax.ejb.EJB"%>
<%@page import="servlets.ServletChargementDonnees"%>
<%@page import="servlets.tools.EtatProduct_Translator"%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<!-- Portfolio des architectes -->

<%
    Product p_tmp = new Product();
    String p_first_path = new String("images/stock_images/900x500_2.jpg");
    List<Photo> listephotos = new ArrayList<Photo>();
    String p_etat_full = new String("");
    EtatProduct_Translator eP_Tra = new EtatProduct_Translator();
%>


<html>
    <head>
        <title>Adopte Un Presta</title>
        <meta charset="utf-8">
        <meta name="description" content="Site de vente de prestataires">
        <meta name="keywords" content="Prestataire, SSII, recrutement, RH, vente">
        <meta name="author" content="Kheira, Jef, William, Tuan">
        <link rel="stylesheet" href="css/style.css">
        <script src="js/jquery-1.7.1.min.js"></script>
        <script src="js/script.js"></script>
    </head>

    <body>

                <!-- PRO Framework Panel Begin -->
        <div id="advanced">
            <span class="trigger">
                <strong></strong>
                <em></em>
            </span>
            <div class="bg_pro">
                <div class="pro_main">
                    <a href="" class="pro_logo"></a>
                    <ul class="pro_menu">
                        <li>
                            <a href="index.jsp">
                                <img src="images/pro_home.png" alt="">
                            </a>
                        </li>

                        <c:if test="${isLoggedIn == 'true'}">
                            <li style="margin-left: 300px">
                                <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=displayCart">Mon Panier</a>
                            </li>
                            <li>
                                <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=afficherMonCompte">Mon Compte</a>
                            </li>
                            <li>
                                <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=logout">Déconnexion</a>
                            </li>
                        </c:if>
                        <c:if test="${isLoggedIn != 'true'}">
                            <li style="margin-left: 300px">
                                <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=displayCart">Mon Panier</a>
                            </li>
                            <li>
                                <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=gotoSubscribe">Inscription</a>
                            </li>
                            <li><a>Se connecter<span></span></a>  
                                <ul>
                                    <form action="/AdopteUnPrestaWA/ServletChargementDonnees?action=login" method="POST">
                                        <div>
                                            <label for="login">Identifiant : </label> <br/>
                                            <input name="login" type="text" size="10" maxlength="255" style="height:15px;font-size:14px;width: 130px"/> <br/><br/>                          
                                        </div>
                                        <div>
                                            <label for="password"> Mot de passe : </label> <br/>
                                            <input name="password" type="password" size="10" maxlength="255" style="height:15px;font-size:14px;width: 130px"/> <br/><br/>
                                        </div>
                                        <input class="btn sign-in" type="submit" value="Connexion" />
                                    </form>
                                </ul>
                            </li>
                        </c:if>
                    </ul>          
                </div>       
            </div>   
        </div>

        <!-- PRO Framework Panel End -->
        <div class="bg-main">

            <!--==============================header=================================-->

            <header>
                <div class="container_24">
                    <div class="wrapper">
                        <div class="grid_13">
                            <h1><a href="index.jsp">Idealex</a></h1>
                        </div>
                        <div class="grid_11">
                            <form action="/AdopteUnPrestaWA/ServletChargementDonnees?action=rechercher" method="POST">
                                <div align="right">
                                    <input style=" font:11px/15px Arial, Helvetica, sans-serif; " type="text" name="search_query">
                                    <input style=" background:#1f2025; font:11px/15px Arial, Helvetica, sans-serif; text-transform:uppercase; color:#eaeaea; padding:8px 8px 8px 8px;" type="submit" value="Rechercher">
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <nav class="main-menu">
                    <ul class="sf-menu">
                        <li><a href="more.jsp"><em>A propos</em><strong></strong></a><ul>
                                <li><a href="more.jsp">Qui sommes-nous ?</a></li>
                                <li><a href="enConstruction.jsp">Nouvelles</a></li>
                                <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=product">Produits</a></li>
                            </ul>
                        </li>
                        <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=product"><em>Produits</em><strong></strong></a><ul>
                                <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=product">Tous</a></li>
                                <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=developer">Développeurs</a></li>
                                <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=projectManager">Chefs de projet</a></li>
                                <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=productManager">Responsables produits</a></li>
                                <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=architect">Architectes</a></li>
                                <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=coach">Coach / Scrum Master</a></li>
                                <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=consultant">Consultants</a></li>
                            </ul>
                        </li>	
                        <li><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=productStores"><em>Partenaires</em><strong></strong></a></li>
                        <li><a href="enConstruction.jsp"><em>Autres</em><strong></strong></a></li>
                        <li><a href="enConstruction.jsp"><em>Clients</em><strong></strong></a></li>
                        <c:set var="etatUtilisateur" scope="session" property="account.accessLevel" />

                        <c:if test="${account.accessLevel == 2}">
                            <!-- c:out value="Bienvenue super-admin" /> -->
                            <li><a href="super-admin.jsp"><em>Administration</em><strong></strong></a><ul>
                                    <li>Compte</li>
                                    <li><a href="ajoutAccount.jsp">Créer Compte</a></li>
                                    <li><a href="modifAccount.jsp">Modifier/Supprimer</a></li>
                                    <li>ProductStore</li>
                                    <li><a href="ajoutProductStore.jsp">Créer ProductStore</a></li>
                                    <li><a href="modifProductStore.jsp">Modifier/Supprimer</a></li>
                                     <li>Prestataires</li>
                                        <li><a href="ajoutPresta.jsp">Créer Presta</a></li>
                                        <li><a href="modifPresta.jsp">Modifier/Supprimer</a></li>     
                                   <li>Autres</li>	
                                </ul>
                            </li>
                        </c:if>
                        <c:if test="${account.accessLevel == 1}">
                            <!-- c:out value="Bienvenue admin" /> -->                                        
                            <li><a href="admin.jsp"><em>Options</em><strong></strong></a><ul>
                                    <li><a href="ajoutPresta.jsp">Créer Presta</a></li>
                                    <li>Autres</li>						
                                </ul>				
                            </li>	


                        </c:if>
                        <c:if test="${account.accessLevel == 0}">
                            <!-- c:out value="Bienvenue utilisateur" /> -->
                            <li></li>
                        </c:if>
                        <li class="last"><a href="contacts.jsp"><em>Contacts</em><strong></strong></a></li>
                    </ul>
                    <div class="clear"></div>
                </nav>
                
            </header>
            <!--==============================section=================================-->
            <section class="padsection7">
                <div class="container_24">
                    <div class="wrapper"><div class="grid_24"><h1 class="title3">Portfolio des Architectes</h1></div></div>
                </div>
                <div class="tabs tabs4">
                    <div class="wrapper">
                        <ul class="layouts-menu">
                            <li class="portfolio1"><a href="#" class="current"><span></span></a></li>
                            <li class="portfolio3_capt"><a href="#" ><span></span></a></li>
                        </ul>
                    </div>

                    <!-- Full-width Begin -->
                    <div class="tab-content">
                        <div class="container_24">
                            <div class="wrapper">
                                <div class="grid_24">
                                    <c:forEach var="item" items="${requestScope['architectes']}"> 
                                        <div class="wrapper pad_port">
                                            <c:set var="p_item" value="${item}" scope="request" />
                                            <%
                                                p_tmp = (Product) request.getAttribute("p_item");
                                                listephotos = (List<Photo>) request.getAttribute("listephotos");
                                                p_first_path = new String("images/stock_images/900x500_2.jpg");
                                                if ((p_tmp != null) && (listephotos != null)) {
                                                    System.err.print("portfolio_architect.jsp -- Listes non nulles");
                                                    p_etat_full = eP_Tra.etat_translate(p_tmp.getEtat());
                                                    if (p_etat_full != null) {
                                                        request.getSession().setAttribute("p_etat_full", p_etat_full);
                                                    }

                                                    Iterator<Photo> itphoto = listephotos.iterator();
                                                    while (itphoto.hasNext()) {
                                                        Photo p_first = itphoto.next();
                                                        if (p_first.getProductidProduct() == p_tmp.getIdProduct()) {
                                                            p_first_path = p_first.getCheminPhoto();
                                                        }
                                                    }
                                                    request.getSession().setAttribute("p_first_path", p_first_path);
                                                    System.err.print("portfolio_architect.jsp -- p_first_path ==" + p_first_path);
                                                }
                                            %>
                                            <div class='image_left'>
                                                <a href='${p_first_path}' data-gal="prettyPhoto[gallery8]" class="image_style3 image_with_capt lightbox-image">
                                                    <img height="340" width="300" src='${p_first_path}' alt="">
                                                </a>
                                            </div>
                                            <c:out value="${item.prenom}"/>
                                            <c:out value="${item.nom}"/><br><br>
                                            <c:out value="Prix : ${item.prix} €"/><br>
                                            <c:out value="Etat : ${p_etat_full}"/><br><br>
                                            <c:out value="Description :${item.description}"/><br>

                                            <div class=" alignright"><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=afficherPresta&selected_presta=${item.idProduct}" class='btn'>Voir fiche du prestataire</a></div>
                                            <c:if test="${account.accessLevel == 2}">
                                                <div class=" alignright"><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=modifierPresta&idPrestaModif=${item.idProduct}" class='btn'>Modifier le prestataire</a></div>
                                                <div class=" alignright"><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=supprimerPresta&idPrestaSup=${item.idProduct}" class='btn'>Supprimer le prestataire</a></div>
                                            </c:if>
                                            <c:if test="${item.etat == '1'}">
                                                <div class=" alignright"><a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=ajouterPrestaPanier&selected_presta=${item.idProduct}" class='btn'>Ajouter au panier</a></div>
                                            </c:if>

                                        </div>
                                    </c:forEach>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- Full-width End -->            


                    <!-- Three with Caption Columns Begin -->
                    <div class="tab-content">
                        <jsp:useBean id="product" scope="session" class="entities.Product"/>
                        <jsp:useBean id="photo" scope="session" class="entities.Photo"/>
                        <div class="container_24">
                            <div class="wrapper">   
                                <div class="grid_8">            

                                    <c:forEach var="item" items="${requestScope['architectes']}" begin="0" end="2" >   
                                        <div class='wrapper pad_port'>
                                            <c:set var="p_item" value="${item}" scope="request" />
                                            <%

                                                p_tmp = (Product) request.getAttribute("p_item");
                                                listephotos = (List<Photo>) request.getAttribute("listephotos");
                                                p_first_path = new String("images/stock_images/900x500_2.jpg");
                                                if ((p_tmp != null) && (listephotos != null)) {
                                                    System.err.print("portfolio_architect.jsp -- Listes non nulles");
                                                    p_etat_full = eP_Tra.etat_translate(p_tmp.getEtat());
                                                    if (p_etat_full != null) {
                                                        request.getSession().setAttribute("p_etat_full", p_etat_full);
                                                    }

                                                    Iterator<Photo> itphoto = listephotos.iterator();
                                                    while (itphoto.hasNext()) {
                                                        Photo p_first = itphoto.next();
                                                        if (p_first.getProductidProduct() == p_tmp.getIdProduct()) {
                                                            p_first_path = p_first.getCheminPhoto();
                                                        }
                                                    }
                                                    request.getSession().setAttribute("p_first_path", p_first_path);
                                                    System.err.print("portfolio_architect.jsp -- p_first_path ==" + p_first_path);
                                                }
                                            %>
                                            <a href='${p_first_path}' data-gal='prettyPhoto[gallery]' class='image_style3 image_with_capt lightbox-image'><img height="340" width="300" src='${p_first_path}' alt=''></a>
                                                <c:out value="${item.nom}"/>         
                                                <c:out value="${item.prenom}"/><br>
                                            <c:out value="${item.description}"/><br>
                                            <c:out value="Prix : ${item.prix} €"/><br>
                                            <c:out value="Etat : ${p_etat_full}"/><br>
                                            <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=afficherPresta&selected_presta=${item.idProduct}" class='btn'>Voir fiche du prestataire</a>
                                            <c:if test="${item.etat == '1'}">
                                                <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=ajouterPrestaPanier&selected_presta=${item.idProduct}" class='btn'>Ajouter au panier</a>
                                            </c:if>
                                        </div>
                                    </c:forEach>  

                                </div>
                                <div class="grid_8">

                                    <c:forEach var="item" items="${requestScope['architectes']}" begin="3" end="5" >   
                                        <div class='wrapper pad_port'>
                                            <c:set var="p_item" value="${item}" scope="request" />
                                            <%
                                                p_tmp = (Product) request.getAttribute("p_item");
                                                listephotos = (List<Photo>) request.getAttribute("listephotos");
                                                p_first_path = new String("images/stock_images/900x500_2.jpg");
                                                if ((p_tmp != null) && (listephotos != null)) {
                                                    System.err.print("portfolio_architect.jsp -- Listes non nulles");
                                                    p_etat_full = eP_Tra.etat_translate(p_tmp.getEtat());
                                                    if (p_etat_full != null) {
                                                        request.getSession().setAttribute("p_etat_full", p_etat_full);
                                                    }

                                                    Iterator<Photo> itphoto = listephotos.iterator();
                                                    while (itphoto.hasNext()) {
                                                        Photo p_first = itphoto.next();
                                                        if (p_first.getProductidProduct() == p_tmp.getIdProduct()) {
                                                            p_first_path = p_first.getCheminPhoto();
                                                        }
                                                    }
                                                    request.getSession().setAttribute("p_first_path", p_first_path);
                                                    System.err.print("portfolio_architect.jsp -- p_first_path ==" + p_first_path);
                                                }
                                            %>
                                            <a href='${p_first_path}' data-gal='prettyPhoto[gallery]' class='image_style3 image_with_capt lightbox-image'><img height="340" width="300" src='${p_first_path}' alt=''></a>
                                                <c:out value="${item.nom}"/>         
                                                <c:out value="${item.prenom}"/><br>
                                            <c:out value="${item.description}"/><br>
                                            <c:out value="Prix : ${item.prix} €"/><br>
                                            <c:out value="Etat : ${p_etat_full}"/><br>
                                            <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=afficherPresta&selected_presta=${item.idProduct}" class='btn'>Voir fiche du prestataire</a>
                                            <c:if test="${item.etat == '1'}">
                                                <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=ajouterPrestaPanier&selected_presta=${item.idProduct}" class='btn'>Ajouter au panier</a>
                                            </c:if>
                                        </div>
                                    </c:forEach>   

                                </div>
                                <div class="grid_8">

                                    <c:forEach var="item" items="${requestScope['architectes']}" begin="6" end="8" >   
                                        <div class='wrapper pad_port'>
                                            <c:set var="p_item" value="${item}" scope="request" />
                                            <%
                                                p_tmp = (Product) request.getAttribute("p_item");
                                                listephotos = (List<Photo>) request.getAttribute("listephotos");
                                                p_first_path = new String("images/stock_images/900x500_2.jpg");
                                                if ((p_tmp != null) && (listephotos != null)) {
                                                    System.err.print("portfolio_architect.jsp -- Listes non nulles");
                                                    p_etat_full = eP_Tra.etat_translate(p_tmp.getEtat());
                                                    if (p_etat_full != null) {
                                                        request.getSession().setAttribute("p_etat_full", p_etat_full);
                                                    }

                                                    Iterator<Photo> itphoto = listephotos.iterator();
                                                    while (itphoto.hasNext()) {
                                                        Photo p_first = itphoto.next();
                                                        if (p_first.getProductidProduct() == p_tmp.getIdProduct()) {
                                                            p_first_path = p_first.getCheminPhoto();
                                                        }
                                                    }
                                                    request.getSession().setAttribute("p_first_path", p_first_path);
                                                    System.err.print("portfolio_architect.jsp -- p_first_path ==" + p_first_path);
                                                }
                                            %>
                                            <a href='${p_first_path}' data-gal='prettyPhoto[gallery]' class='image_style3 image_with_capt lightbox-image'><img height="340" width="300" src='${p_first_path}' alt=''></a>
                                                <c:out value="${item.nom}"/>         
                                                <c:out value="${item.prenom}"/><br>
                                            <c:out value="${item.description}"/><br>
                                            <c:out value="Prix : ${item.prix} €"/><br>
                                            <c:out value="Etat : ${p_etat_full}"/><br>
                                            <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=afficherPresta&selected_presta=${item.idProduct}" class='btn'>Voir fiche du prestataire</a>
                                            <c:if test="${item.etat == '1'}">
                                                <a href="/AdopteUnPrestaWA/ServletChargementDonnees?action=ajouterPrestaPanier&selected_presta=${item.idProduct}" class='btn'>Ajouter au panier</a>
                                            </c:if>                                                    
                                        </div>
                                    </c:forEach>  

                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- Three with Caption Columns End -->

                </div>
            </section>	
        </div>
        <!--==============================footer=================================-->
        <footer>
            <div class=" container_24">
                <div class="wrapper">
                    <div class="grid_6 suffix_2">
                        <h1 class="footer-logo"><a href="index.jsp">idealex</a></h1>
                        <p>Adopte Un Presta</p>
                        <p class="color1 privacy">&copy; 2013 <span>|</span>  <a href="index-7.html">Politique de confidentialité</a> <!-- {%FOOTER_LINK} --></p>
                    </div>
                    <div class="grid_7 suffix_2">
                        <h4>Liens connexes</h4>
                        <div class="wrapper">
                            <div class="grid_4 alpha">
                                <ul class="footer-list">
                                    <li><a href="more.jsp">A propos de nous</a></li>
                                    <li><a href="more.jsp">Notre concept</a></li>
                                    <li><a href="more.jsp">Nos partenaires</a></li>
                                    <li><a href="more.jsp">Evénements &amp; Press</a></li>
                                    <li><a href="more.jsp">Nous contacter</a></li>
                                </ul>
                            </div>
                            <div class="grid_3 omega">
                                <ul class="footer-list">
                                    <li><a href="more.jsp">Se connecter</a></li>
                                    <li><a href="more.jsp">Forums</a></li>
                                    <li><a href="more.jsp">Programme de fidélité</a></li>
                                    <li><a href="more.jsp">FAQ</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="grid_7">
                        <h4>Nous suivre</h4>
                        <ul class="tooltips">
                            <li><a href="more.jsp"><img src="images/icon1.png" alt=""><span>RSS</span></a></li>
                            <li><a href="more.jsp"><img src="images/icon3.png" alt=""><span>Facebook</span></a></li>
                            <li><a href="more.jsp"><img src="images/icon2.png" alt=""><span>Twitter</span></a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </footer>
    </body>
</html>


